import type {
  EntityApi,
  EntityReq,
  EntityModel,
  EntityList,
  EntityKey,
  EntityCreateReq,
  EntityUpdateReq,
} from "jmash-core";

// 接口
export interface TaskAttachmentApi extends EntityApi {}

// 查询
export interface TaskAttachmentReq extends EntityReq {
  tenant?: string;
  //任务ID.
  taskId?: string;
  //流程实例ID.
  procInstId?: string;
}

// 任务附件主键.
export interface TaskAttachmentKey extends EntityKey {
  tenant?: string;
  attachmentId?: string;
}

/**
 * 任务附件列表.
 */
export interface TaskAttachmentList extends EntityList {
  /**
   * 当前页内容.
   */
  results: Array<TaskAttachmentModel>;
}

/**
 * 任务附件实体.
 */
export interface TaskAttachmentModel extends EntityModel {
  /**
   * ID.
   */
  id?: string;
  /**
   * 任务名称.
   */
  name?: string;
  /**
   * 任务描述.
   */
  description?: string;
  /**
   * 类型.
   */
  type?: string;
  /**
   * 任务ID.
   */
  taskId?: string;
  /**
   * 流程实例ID.
   */
  processInstanceId?: string;
  /**
   * Url.
   */
  url?: string;
  /**
   * 用户ID.
   */
  userId?: string;
  /**
   * 创建时间.
   */
  time?: string;
}

/**
 * 任务附件新增实体.
 */
export interface TaskAttachmentCreateReq extends EntityCreateReq {
  /**
   * 任务ID.
   */
  taskId?: string;
  /**
   * 附件名称.
   */
  name?: string;
  /**
   * 附件描述.
   */
  description?: string;
  /**
   * 类型.
   */
  type?: string;
  /**
   * Url.
   */
  url?: string;
  /**
   * 附件ID.
   */
  attachmentId?: string;
}
/**
 * 任务附件修改实体.
 */
export interface TaskAttachmentUpdateReq extends EntityUpdateReq {
  /**
   * 附件ID.
   */
  attachmentId?: string;
  /**
   * 任务ID.
   */
  taskId?: string;
  /**
   * 附件名称.
   */
  name?: string;
  /**
   * 附件描述.
   */
  description?: string;
  /**
   * 类型.
   */
  type?: string;
  /**
   * Url.
   */
  url?: string;
}

export type TaskAttachmentFromReq =
  | TaskAttachmentUpdateReq
  | TaskAttachmentCreateReq;
